<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright © 2013-2016 The Nxt Core Developers.                            ~
  ~ Copyright © 2016-2017 Jelurida IP B.V.                                    ~
  ~                                                                           ~
  ~ See the LICENSE.txt file at the top-level directory of this distribution  ~
  ~ for licensing information.                                                ~
  ~                                                                           ~
  ~ Unless otherwise agreed in a custom licensing agreement with Jelurida B.V.,
  ~ no part of the Nxt software, including this file, may be copied, modified,~
  ~ propagated, or distributed except according to the terms contained in the ~
  ~ LICENSE.txt file.                                                         ~
  ~                                                                           ~
  ~ Removal or modification of this copyright notice is prohibited.           ~
  ~                                                                           ~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

<div class="modal fade" id="asset_order_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <!-- todo -->
                <h4 class="modal-title"><span data-i18n="confirm_order">Confirm Order</span> (<span class="asset_order_modal_type"></span>)</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="form-group">
                        <label data-i18n="order_description">ORDER DESCRIPTION</label>
                        <p id="asset_order_description"></p>
                        <input type="hidden" name="asset" id="asset_order_asset" value="" />
                        <input type="hidden" name="quantityQNT" id="asset_order_quantity" value="" />
                        <input type="hidden" name="priceNQT" id="asset_order_price" value="" />
                        <input type="hidden" name="deadline" id="asset_order_deadline" data-default="24" value="24" />
                    </div>
                    <div class="form-group">
                        <label><span data-i18n="total">TOTAL</span> <i id="asset_order_total_tooltip" class="fa fa-question-circle" style="color:#4CAA6E" data-toggle="popover" data-placement="right" data-content=""></i></label>
                        <p id="asset_order_total"></p>
                    </div>
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>
                    <input type="hidden" name="asset_order_type" id="asset_order_type" />
                    <input type="hidden" name="request_type" value="orderAsset" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>
                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." id="asset_order_modal_button" data-i18n="[data-loading-text]submitting"></button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="transfer_asset_modal" data-transaction-type="2" data-transaction-subtype="1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="transfer_asset_title"></h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="form-group">
                        <label data-i18n="asset">ASSET</label>
                        <p><span id="transfer_asset_name"></span><span id="transfer_asset_available" style="font-style:italic"></span></p>
                        <input type="hidden" name="asset" id="transfer_asset_asset" value="" />
                        <input type="hidden" name="decimals" id="transfer_asset_decimals" value="" />
                        <input type="hidden" id="transfer_asset_action" value="" />
                    </div>
                    <div id="transfer_asset_recipient_container">
                        <div data-replace-with-modal-template="recipient_modal_template"></div>
                    </div>
                    <div class="form-group">
                        <label for="transfer_asset_quantity" data-i18n="quantity">QUANTITY</label>
                        <div class="input-group">
                            <input type="number" name="quantity" id="transfer_asset_quantity" class="form-control" step="any" min="0" placeholder="Quantity" data-i18n="[placeholder]quantity" tabindex="3">
                            <span class="input-group-addon" id="transfer_asset_quantity_name"></span>
                        </div>
                    </div>
                    <div data-replace-with-modal-template="add_message_modal_template"></div>
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>

                    <div class="callout account_info" style="display:none;margin-bottom: 0;"></div>
                    <input type="hidden" id="transfer_asset_request_type" name="request_type"/>
                    <input type="hidden" name="converted_account_id" value="" />
                    <input type="hidden" name="merchant_info" value="" data-default="" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>

                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="submit;[data-loading-text]submitting">Submit</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="cancel_order_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="confirm_order_cancellation">Confirm Order Cancellation</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <p data-i18n="confirm_order_cancellation_help">If you are sure you want to cancel your order, type your passphrase to confirm.</p>
                    <input type="hidden" name="order" id="cancel_order_order" value="" />
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>

                    <input type="hidden" name="cancel_order_type"  id="cancel_order_type" />
                    <input type="hidden" name="request_type" value="cancelOrder" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>

                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="no_do_not_cancel">No, Do Not Cancel</button>
                <button type="button" class="btn btn-primary" id="cancel_order_button" data-loading-text="Submitting..." data-i18n="cancel_my_order;[data-loading-text]submitting">Cancel My Order</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="add_asset_bookmark_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="add_asset">Add Asset</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="form-group">
                        <label for="add_asset_bookmark_id" data-i18n="asset_or_account_id">ASSET OR ACCOUNT ID</label> <i class="fa fa-question-circle show_popover" style="color:#4CAA6E" data-content="Find the ID on the issuer's website or announcement page." data-container="body" data-i18n="[data-content]find_asset_id_help"></i>
                        <input type="text" class="form-control" name="id" id="add_asset_bookmark_id" placeholder="ID" autofocus tabindex="1" />
                    </div>
                    <input type="hidden" name="request_type" value="addAssetBookmark" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="add_asset;[data-loading-text]submitting">Add Asset</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="issue_asset_modal" data-transaction-type="2" data-transaction-subtype="0" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="issue_asset">Issue Asset</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger never_hide">
                        <strong><span data-i18n="warning">Warning</span>:</strong>
                        <span data-i18n="issue_asset_warning">Once submitted, you will not be able to change this information again, ever. Make sure it is correct.</span>
                    </div>
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="form-group">
                        <label for="issue_asset_name"><span data-i18n="asset_name">ASSET NAME</span> <i class="fa fa-question-circle show_popover" data-content="The asset name is non-unique. Should be between 3 and 10 characters long." data-i18n="[data-content]asset_name_help" data-container="body" style="color:#4CAA6E" ></i></label>
                        <input type="text" class="form-control" name="name" id="issue_asset_name" placeholder="Asset Name" data-i18n="[placeholder]asset_name" autofocus tabindex="1" />
                    </div>
                    <div class="form-group">
                        <label for="issue_asset_description" data-i18n="description">DESCRIPTION</label>
                        <textarea class="form-control" id="issue_asset_description" name="description" rows="3" tabindex="3"></textarea>
                    </div>
                    <div class="input-group">
                        <input type="checkbox" id="issue_asset_singleton"/>
                        <label for="issue_asset_singleton" style="font-weight:normal;" tabindex="10" data-i18n="is_singleton_asset">SINGLETON ASSET</label>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="issue_asset_quantity" data-i18n="quantity">QUANTITY</label>
                                <input type="number" name="quantity" id="issue_asset_quantity" class="form-control" min="1" placeholder="Quantity" data-i18n="quantity" tabindex="4">
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="issue_asset_decimals"><span data-i18n="decimals">DECIMALS</span> <i class="fa fa-question-circle show_popover" data-content="The maximum allowed number of digits after the asset quantity decimal point." data-i18n="[data-content]asset_decimals_help" data-container="body" style="color:#4CAA6E" ></i></label>
                                <input type="number" name="decimals" id="issue_asset_decimals" class="form-control" min="0" max="8" placeholder="Decimals" data-i18n="decimals" data-default="0" value="0" tabindex="5">
                            </div>
                        </div>
                    </div>
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>

                    <input type="hidden" name="request_type" value="issueAsset" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>

                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="issue_asset;[data-loading-text]submitting">Issue Asset</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="asset_distribution_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-dialog-wider">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="Asset Distribution">Asset Distribution</h4>
            </div>
            <div class="modal-body">                            
                <div class="data-container data-loading" style="max-height:350px;overflow:auto">
                    <table class="table table-striped" id="asset_distribution_table">
                        <thead>
                        <tr>
                            <th data-i18n="account">Account</th>
                            <th data-i18n="quantity">Quantity</th>
                            <th data-i18n="percentage">Percentage</th>
                        </tr>
                        </thead>
                        <tbody>
                        
                        </tbody>
                    </table>
                    <div class="data-loading-container"><img src="img/loading_indicator.gif" alt="Loading..." width="32" height="32" /></div>
                    <div class="data-empty-container"><p data-i18n="error">Error</p></div>
                </div>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-primary" data-dismiss="modal" data-i18n="close">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="asset_dividend_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-dialog-wider">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="asset_dividend_history">Asset Dividend History</h4>
            </div>
            <div class="modal-body">
                <div id="asset_dividend" style="max-height:350px;overflow:auto">
                    <script type="text/x-handlebars-template">
                        <div class="data-container {{when isLoading 'data-loading' isEmpty 'data-empty'}}">
                            <table class="table table-striped" id="asset_dividend_table">
                                <thead>
                                    <tr>
                                        <th>{{i18n "date"}}</th>
                                        <th class='numeric'>{{i18n "dividend_height"}}</th>
                                        <th class='numeric'>{{i18n "total"}}</th>
                                        <th class='numeric'>{{i18n "accounts"}}</th>
                                        <th class='numeric'>{{i18n "amount_per_share"}}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {{#each data}}
                                    <tr>
                                        <td>{{{timestamp}}}</td>
                                        <td class='numeric'>{{dividend_height}}</td>
                                        <td class='numeric'>{{{total}}}</td>
                                        <td class='numeric'>{{{accounts}}}</td>
                                        <td class='numeric'>{{{amount_per_share}}}</td>
                                    </tr>
                                    {{/each}}
                                    </tbody>
                            </table>
                            <div class="data-loading-container"><img src="img/loading_indicator.gif" alt="Loading..." width="32" height="32" /></div>
                            <div class="data-empty-container">
                                <p>
                                    <span>{{i18n "no_recent_dividend_history"}}</span>
                                </p>
                            </div>
                        </div>
                    </script>
                </div>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-primary" data-dismiss="modal" data-i18n="close">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="asset_exchange_change_group_name_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="change_group_name">Change Group Name</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <p data-i18n="change_group_name_help">Type a new group name.</p>
                    <div class="form-group">
                        <label data-i18n="old_group_name">OLD GROUP NAME</label>
                        <p id="asset_exchange_change_group_name_old_display"></p>
                        <input type="hidden" name="old_group_name" id="asset_exchange_change_group_name_old" value="" />
                    </div>
                    <div class="form-group">
                        <label for="asset_exchange_change_group_name_new" data-i18n="new_group_name">NEW GROUP_NAME</label>
                        <input type="text" class="form-control" name="new_group_name" id="asset_exchange_change_group_name_new" placeholder="New group name" data-i18n="[placeholder]new_group_name" />
                    </div>
                    <input type="hidden" name="request_type" value="assetExchangeChangeGroupName" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" id="asset_exchange_change_group_name_submit" data-loading-text="Submitting..." data-i18n="change_group_name;[data-loading-text]submitting">Change Group Name</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="asset_exchange_group_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="group_asset">Group Asset</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <p data-i18n="group_asset_help">Choose a group for this asset.</p>
                    <div class="form-group">
                        <label data-i18n="asset">ASSET</label>
                        <p id="asset_exchange_group_title"></p>
                        <input type="hidden" name="asset_exchange_group_asset" id="asset_exchange_group_asset" value="" />
                    </div>
                    <div class="form-group">
                        <label for="asset_exchange_group_group" data-i18n="group">GROUP</label>
                        <select name="asset_exchange_group_group" id="asset_exchange_group_group" class="form-control">
                        </select>
                    </div>
                    <div class="form-group" id="asset_exchange_group_new_group_div" style="display:none">
                        <input type="text" class="form-control" name="asset_exchange_group_new_group" id="asset_exchange_group_new_group" placeholder="New Group Title" data-i18n="new_group_title"/>
                    </div>
                    <input type="hidden" name="request_type" value="assetExchangeGroup" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" id="asset_exchange_group_submit" data-loading-text="Submitting..." data-i18n="add_to_group;[data-loading-text]submitting">Add to Group</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="dividend_payment_modal" data-transaction-type="2" data-transaction-subtype="6" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="pay_dividends">Pay Dividends</h4>
            </div>
            <div class="modal-body">
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6" data-normal="12" data-advanced="6">
                            <div class="form-group">
                                <label for="dividend_payment_amount_per_share"><span data-i18n="amount_per_share">AMOUNT PER SHARE</span></label>
                                <div class="input-group">
                                    <input type="number" name="amountNXTPerShare" id="dividend_payment_amount_per_share" class="form-control" placeholder="" step="any" tabindex="1">
                                    <span class="input-group-addon">NXT</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="dividend_payment_height"><span data-i18n="height">HEIGHT</span></label> <i>Current Height: <span class="nrs_current_block"></span></i> <i class="fa fa-exclamation-circle show_popover" data-content="Dividend calculation height must be within the last 1440 blocks." data-i18n="[data-content]dividend_payment_height_help" data-container="body" style="color:red"></i>
                                <input type="number" name="height" id="dividend_payment_height" class="form-control" min="0" placeholder="Height" data-i18n="height" data-default="" value="" tabindex="2">
                            </div>
                        </div>
                    </div>
                    <div data-replace-with-modal-template="add_public_message_modal_template"></div>
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>
                    
                    <div class="callout dividend_payment_info" style="display:none;margin-bottom: 0;"></div>
                    <input type="hidden" name="request_type" value="dividendPayment" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>

                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="pay_dividends;[data-loading-text]submitting">Pay Dividends</button>
            </div>
        </div>
    </div>
</div>